import urllib.request
url = 'http://www.baidu.com'
response = urllib.request.urlopen(url)
#read

#print(response.read().decode('utf-8'))
# print(response.readline())
# print(response.readlines())
# print(response.geturl())
# print(dir(response))
# print(response.getcode())
print(response.getheaders())